VERSION 5.00
Begin VB.Form frmSettings 
   AutoRedraw      =   -1  'True
   BackColor       =   &H0099BABD&
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "TorrenTV Settings"
   ClientHeight    =   4050
   ClientLeft      =   12210
   ClientTop       =   5985
   ClientWidth     =   5865
   ControlBox      =   0   'False
   BeginProperty Font 
      Name            =   "Verdana"
      Size            =   9.75
      Charset         =   0
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   ForeColor       =   &H00828B8F&
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4050
   ScaleWidth      =   5865
   ShowInTaskbar   =   0   'False
   Visible         =   0   'False
   Begin VB.CheckBox chkPirateBay 
      BackColor       =   &H0099BABD&
      Caption         =   "Use piratebay.org"
      Height          =   240
      Left            =   3240
      TabIndex        =   20
      ToolTipText     =   "ThePirateBay has been in the news a lot lately.  They have quality torrents with lots of seeders."
      Top             =   2160
      Width           =   2535
   End
   Begin VB.CheckBox chkMininova 
      BackColor       =   &H0099BABD&
      Caption         =   "Use mininova.org"
      Height          =   240
      Left            =   3240
      TabIndex        =   19
      ToolTipText     =   "Mininova has more torrents than any of these other guys, but the quality is not always up to par."
      Top             =   2520
      Value           =   1  'Checked
      Width           =   2535
   End
   Begin VB.CheckBox chkMinimize 
      BackColor       =   &H0099BABD&
      Caption         =   "Minimize on Load"
      Height          =   240
      Left            =   3600
      TabIndex        =   17
      ToolTipText     =   "Minimizes the SystemTray, so you don't have to 'hide' it at every reboot."
      Top             =   3240
      Width           =   2415
   End
   Begin VB.CheckBox chkStartWithWindows 
      BackColor       =   &H0099BABD&
      Caption         =   "Start program with Windows"
      Height          =   240
      Left            =   120
      TabIndex        =   16
      ToolTipText     =   "Starts program everytime windows boots up."
      Top             =   3240
      Width           =   3450
   End
   Begin VB.CheckBox chkEzTV 
      BackColor       =   &H0099BABD&
      Caption         =   "Use ezTV.it"
      Enabled         =   0   'False
      Height          =   240
      Left            =   120
      TabIndex        =   15
      ToolTipText     =   "ezTV is reliable, fast, and trustworthy (and required)."
      Top             =   2160
      Value           =   1  'Checked
      Width           =   1695
   End
   Begin VB.CheckBox chkISOHunt 
      BackColor       =   &H0099BABD&
      Caption         =   "Use isoHunt.com"
      Height          =   240
      Left            =   120
      TabIndex        =   14
      ToolTipText     =   "ISOHunt is not well known, but has amazing content and has the most recent releases."
      Top             =   2520
      Width           =   2175
   End
   Begin VB.ComboBox cboHour 
      Appearance      =   0  'Flat
      BackColor       =   &H0099BABD&
      ForeColor       =   &H00000000&
      Height          =   360
      ItemData        =   "frmSettings.frx":0000
      Left            =   4440
      List            =   "frmSettings.frx":004C
      Style           =   2  'Dropdown List
      TabIndex        =   13
      ToolTipText     =   "What time of day would you like TorrenTV to check for new episodes?"
      Top             =   1680
      Visible         =   0   'False
      Width           =   1335
   End
   Begin VB.ComboBox cboTime 
      Appearance      =   0  'Flat
      BackColor       =   &H0099BABD&
      ForeColor       =   &H00000000&
      Height          =   360
      ItemData        =   "frmSettings.frx":00E8
      Left            =   3240
      List            =   "frmSettings.frx":0101
      Style           =   2  'Dropdown List
      TabIndex        =   10
      ToolTipText     =   "How often should TorrenTV check for new episodes?"
      Top             =   1680
      Width           =   975
   End
   Begin VB.ComboBox cboRating 
      Appearance      =   0  'Flat
      BackColor       =   &H0099BABD&
      ForeColor       =   &H00000000&
      Height          =   360
      ItemData        =   "frmSettings.frx":013A
      Left            =   3480
      List            =   "frmSettings.frx":014D
      Style           =   2  'Dropdown List
      TabIndex        =   7
      ToolTipText     =   "ISOHunt has ""ratings"", mininova has ""thanks"".  This prevents the downloading of unverified and possibly-inaccurate torrents."
      Top             =   2805
      Width           =   735
   End
   Begin VB.TextBox txtTorrent 
      Appearance      =   0  'Flat
      BackColor       =   &H0099BABD&
      ForeColor       =   &H00000000&
      Height          =   360
      Left            =   120
      Locked          =   -1  'True
      TabIndex        =   1
      Text            =   "C:\"
      ToolTipText     =   "Location of BitTorrent Client (default is C:\Program Files\uTorrent)"
      Top             =   1200
      Width           =   5655
   End
   Begin VB.TextBox txtDir 
      Appearance      =   0  'Flat
      BackColor       =   &H0099BABD&
      ForeColor       =   &H00000000&
      Height          =   360
      Left            =   120
      Locked          =   -1  'True
      TabIndex        =   0
      Text            =   "C:\"
      ToolTipText     =   "Location where torrents will be downloaded."
      Top             =   360
      Width           =   5655
   End
   Begin VB.Label lblAt 
      BackStyle       =   0  'Transparent
      Caption         =   "@"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   4245
      TabIndex        =   12
      Top             =   1740
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Label lblTime 
      BackStyle       =   0  'Transparent
      Caption         =   "Look for new episodes every"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   120
      TabIndex        =   11
      Top             =   1755
      Width           =   3255
   End
   Begin VB.Label lblRating2 
      BackStyle       =   0  'Transparent
      Caption         =   "before DL'ing"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   4320
      TabIndex        =   9
      Top             =   2880
      Width           =   1455
   End
   Begin VB.Label lblSave 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Save Settings"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   285
      Left            =   1920
      TabIndex        =   8
      ToolTipText     =   "Go back to the main screen."
      Top             =   3600
      Width           =   1935
   End
   Begin VB.Label lblRating1 
      BackStyle       =   0  'Transparent
      Caption         =   "Wait until torrent has rating of"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   120
      TabIndex        =   6
      Top             =   2880
      Width           =   3495
   End
   Begin VB.Label lblTorrentChange 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Change"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   -1  'True
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   4800
      TabIndex        =   5
      Top             =   960
      Width           =   975
   End
   Begin VB.Label lblDirChange 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Change"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   -1  'True
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   4800
      TabIndex        =   4
      ToolTipText     =   "Change the default torrent download directory."
      Top             =   120
      Width           =   975
   End
   Begin VB.Label lblTorrent 
      BackStyle       =   0  'Transparent
      Caption         =   "Torrents downloaded with (uTorrent):"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   120
      TabIndex        =   3
      Top             =   960
      Width           =   4455
   End
   Begin VB.Label lblDir 
      BackStyle       =   0  'Transparent
      Caption         =   "Torrents downloaded to:"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   120
      Width           =   2655
   End
   Begin VB.Label lblSave2 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Save Settings"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00808080&
      Height          =   285
      Left            =   1980
      TabIndex        =   18
      Top             =   3645
      Width           =   1935
   End
End
Attribute VB_Name = "frmSettings"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit

Private Sub cboHour_Click()
    frmMain.regSet "hour", CStr(cboHour.ListIndex)
End Sub

Private Sub cboRating_Click()
    Call frmMain.regSet("rating", cboRating.List(cboRating.ListIndex))
End Sub

Private Sub cboTime_Click()
    frmMain.regSet "time", cboTime.Text
    If cboTime.ListIndex = 6 Then
        lblAt.Visible = True
        cboHour.Visible = True
    Else
        lblAt.Visible = False
        cboHour.Visible = False
    End If
End Sub

Private Sub chkEzTV_Click()
    If chkISOHunt.Value = 0 And chkEzTV.Value = 0 Then
        MsgBox "You HAVE to use either ISOHunt OR ezTV.  This program will not operate without a source website." + vbCrLf + vbCrLf + "Note: You can use BOTH!", vbInformation + vbOKOnly, "TorrenTV"
        chkEzTV.Value = 1
    End If
    frmMain.regSet "eztv", CStr(chkEzTV.Value)
End Sub

Private Sub chkISOHunt_Click()
    If chkISOHunt.Value = 0 And chkEzTV.Value = 0 Then
        'MsgBox "You HAVE to use either ISOHunt OR ezTV.  This program will not operate without a source website." + vbCrLf + vbCrLf + "Note: You can use BOTH!", vbInformation + vbOKOnly, "TorrenTV"
        chkISOHunt.Value = 1
    End If
    frmMain.regSet "isohunt", CStr(chkISOHunt.Value)
End Sub

Private Sub chkMinimize_Click()
    frmMain.regSet "start_minimized", CStr(chkMinimize.Value)
End Sub

Private Sub chkMininova_Click()
    frmMain.regSet "mininova", CStr(chkMininova.Value)
End Sub

Private Sub chkPirateBay_Click()
    frmMain.regSet "piratebay", CStr(chkPirateBay.Value)
End Sub

Private Sub chkStartWithWindows_Click()
    Dim s$
    s$ = ""
    
    frmMain.regSet "start_with_windows", CStr(chkStartWithWindows.Value)
    If chkStartWithWindows.Value = 1 Then
        s$ = App.Path + IIf(Right(App.Path, 1) = "\", "", "\") + App.EXEName
    End If
    
    frmMain.savestring &H80000001, "Software\Microsoft\Windows\CurrentVersion\Run", "TorrenTV", s$
End Sub

Private Sub Form_Load()
    Dim s$, i&
    
    txtDir.Text = frmMain.C_DIR$
    txtTorrent.Text = frmMain.C_CLIENT$
    
    s$ = frmMain.regGet("rating")
    If s$ = "" Then
        s$ = "+1"
        frmMain.regSet "rating", s$
    End If
    For i& = 0 To cboRating.ListCount - 1
        If cboRating.List(i&) = s$ Then
            cboRating.ListIndex = i&
            s$ = "XXX"
            Exit For
        End If
    Next i&
    
    Select Case frmMain.regGet("time")
    Case "5 Min"
        cboTime.ListIndex = 0
    Case "15 Min"
        cboTime.ListIndex = 1
    Case "30 Min"
        cboTime.ListIndex = 2
    Case "Hour"
        cboTime.ListIndex = 3
    Case "6 Hours"
        cboTime.ListIndex = 4
    Case "12 Hours"
        cboTime.ListIndex = 5
    Case "Day"
        cboTime.ListIndex = 6
        cboTime_Click
    Case Else
        cboTime.ListIndex = 1
    End Select
    frmMain.regSet "time", cboTime.Text
    
    s$ = frmMain.regGet("hour")
    If s$ = "" Or IsNumeric(s$) = False Then s$ = "12"
    i& = CLng(s$)
    cboHour.ListIndex = i&
    
    If frmMain.regGet("start_with_windows") = "1" Then
        chkStartWithWindows.Value = 1
    End If
    If frmMain.regGet("start_minimized") = "1" Then
        chkMinimize.Value = 1
    End If
    
    If frmMain.regGet("isohunt") = "0" Then
        chkISOHunt.Value = 0
    End If
    If frmMain.regGet("mininova") = "1" Then
        chkMininova.Value = 0
    End If
    If frmMain.regGet("piratebay") = "0" Then
        chkPirateBay.Value = 0
    End If
    
    If s$ <> "XXX" Then cboRating.ListIndex = 4
End Sub

Private Sub lblDirChange_Click()
    Dim s$
    
    s$ = frmMain.GetFolderName$
    If s$ = "" Then Exit Sub
    
    txtDir.Text = s$
    frmMain.regSet "dir", s$
    frmMain.C_DIR$ = s$
End Sub

Private Sub lblSave_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
    frmMain.ControlMousedown Button, lblSave, lblSave2
End Sub
Private Sub lblSave_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
    frmMain.ControlMousemove Button, lblSave, lblSave2, x, Y
End Sub
Private Sub lblSave_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
    If frmMain.ControlMouseup(Button, lblSave, lblSave2) = True Then
        Me.Hide
        Unload Me
        frmMain.tmr.Tag = "-1"
        frmMain.tmr_Timer
    End If
End Sub

Private Sub lblTorrentChange_Click()
    Dim s$
    s$ = frmMain.getopen$()
    If s$ <> "" And Len(Dir(s$)) <> 0 Then
        txtTorrent.Text = s$
        frmMain.C_CLIENT$ = s$
    End If
End Sub
